
// Table 7: Effects of study characteristics on Belief Updating

	use "$root/output/analysis_finaldataset.dta", clear
		
	global controls male experience i.titlecode i.agencyid i.regioncode subnational	
	
	eststo clear
	eststo m1 : qui reg update_binary treat_script_rct schoolsize developing, cl(country_id)
	eststo m2 : qui reg update_binary treat_script_rct schoolsize developing if inlist(country_id,17,31)!=1, cl(country_id)			
	eststo m3 : qui reg update_binary treat_script_rct schoolsize developing rcts30  , cl(country_id)
	eststo m4 : qui reg update_binary treat_script_rct schoolsize developing rcts30 treatXrcts30  , cl(country_id)	
	estadd ysumm : *	
	
	//Stata output
	estout, replace type style(smcl) ///
			label stats(N r2 ymean,fmt(%9.0gc 3 2)labels("N" "R2" "Baseline Mean")) cells(b(star fmt(3)) se(par)) starlevels(* 0.1 ** 0.05 *** 0.01) noomitted ///
			collabel("")  ///
			keep(*treat_script_rct treatXrcts30 schoolsize developing rct*) ///
			nobaselevels mlabel("Full Sample" "Exc Kenya/SA" "Full Sample" "Full Sample")			
	
	//Latex table
	esttab using tables/updating_reg.tex, replace booktabs ///
			se b("%12.3f") ///
			label stats(N r2 ymean, fmt(%9.0gc 3 2)labels("Obs." "R\sym{2}" "Baseline Mean"))  starlevels(* 0.1 ** 0.05 *** 0.01) f noomitted ///
			keep(*treat_script_rct treatXrcts30 schoolsize developing rct*) ///
			nobaselevels mlabel("Full" "Exc Kenya/SA" "Full" "Full") compress ///			
			refcat(treat_script_rct "\textit{Study Characteristics:}" rcts30 "\hline \textit{Country Characteristics:}", nolabel)	
			
			
	
	
